package com.cg.controller;

import com.cg.client.AppClient;
import com.cg.dto.HealthInfoPageDto;
import com.cg.dto.Result;
import com.cg.vo.HealthInfoVo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * (HealthInfo)表控制层
 *
 * @author chengong
 * @since 2024-01-14 15:38:18
 */
@RestController
@RequestMapping("/healthInfo")
public class HealthInfoController {
    /**
     * 服务对象
     */
    @Resource
    private AppClient appClient;

    /**
     * 健康资讯信息展示
     */
    @PostMapping("/queryHealthList")
    public Result<List<HealthInfoVo>> queryHealthList() {
        return appClient.queryHealthList();
    }


    /**
     * 根据标题模糊查询资讯
     */
    @PostMapping("/queryHealthListByTitle")
    public Result<Map<String,Object>> queryHealthListByTitle(HealthInfoPageDto healthInfoPageDto){
        return appClient.queryHealthListByTitle(healthInfoPageDto);
    }
}

